<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
		<title>填写信用卡信息</title>
		<link rel="stylesheet" type="text/css" href="css/public.css"/>
		<link rel="stylesheet" type="text/css" href="css/larea.css"/>
	</head>
	<style type="text/css">
		/*移动端1px下边线*/
		.border{position: relative;}
		.border:after{ content: ''; display:block; position: absolute; width: 100%; left: 0px; bottom: 0px;height: 1px; background-color:  #efefef; -webkit-transform: scaleY(0.5); transform: scaleY(0.5);}
		.lable{height: 0.88rem;font-size: 0.28rem;padding-left: 0.4rem;}
		.item{height: 1.1rem;background: #fff;font-size: 0.3rem;font-weight: bold;}
		.item img{width: 0.43rem;height: auto;margin-left: 0.7rem;}
		.item p{margin-left: 0.4rem;}
		.item input{margin-left: 0.5rem;font-size: 0.3rem;}
		.confirm{height: 0.88rem;width: 6.8rem;margin: 0.52rem auto;font-size: 0.3rem;background: #0D6FB8;border-radius: 5px;color: #fff;cursor: pointer;}
	</style>
	<body>
		<!--头部header开始-->
		<header class="flex flex-align-center">
			<div class="left flex flex-align-center" onclick="Util.back()">
				<img src="img/arrleft.png" alt="" class="arrleft"/>
			</div>
			<div class="title">填写信用卡信息</div>
			<div class="right flex flex-pack-center flex-align-center">
			</div>
		</header><!--头部header结束-->
		<!--内容部分开始-->
		<div class="container">
			<div class="lable flex flex-align-center"><p>请选择开户银行</p></div>
			<div class="item flex flex-align-center">
				<p>开户银行：</p>
				<input type="text"  placeholder="请输入开户银行" id='shortName' readOnly='readOnly'/>
			</div>
			<div class="lable flex flex-align-center"><p>请输入安全码</p></div>
			<div class="item flex flex-align-center">
				<p>安全码：</p>
				<input type="number"  placeholder="请输入银行卡背后3位数" id='cvn2'/>
				<img src="img/warning.png" alt="" id="security"/>
			</div>
			<div class="lable flex flex-align-center"><p>请输入有效期</p></div>
			<div class="item flex flex-align-center border">
				<p>有效期：</p>
				<input type="number"  placeholder="正面有效期 如：05/21 写0521" id='expDate'/>
				<img src="img/warning.png" alt="" id="Term"/>
			</div>
			<div class="lable flex flex-align-center" style="height: 0.5rem;"></div>
			<div class="item flex flex-align-center">
				<p>手机号：</p>
				<input type="number"  placeholder="请输入银行预留手机号" id='phoneNo'/>
			</div>
			<div class="confirm flex flex-align-center flex-pack-center"><p>提交</p></div>
		</div><!--内容部分结束-->
	</body>
	<script type="text/javascript" src="js/rem.js"></script>
	<script type="text/javascript" src="js/zepto.js"></script>
	<script type="text/javascript" src="js/template.js"></script>
	<script type="text/javascript" src="js/api.js"></script>
	<script type="text/javascript" src="js/common.js"></script>
	<script type="text/javascript" src="js/layer.js"></script>
	<script type="text/javascript">
		$('#shortName').val(localStorage.shortName);
		$('#security').click(function(){
			layer.open({
			    content: '安全码为信用卡背后尾三位</br>如5759043则输入043'
			    ,btn: '我知道了'
			  });
		});
		$('#Term').click(function(){
			layer.open({
			    content: '请输入信用卡正面有效期</br>如05/22,则输入0522'
			    ,btn: '我知道了'
			  });
		});
		$('.confirm').click(function(){
			var phoneNo = $('#phoneNo').val();
			var expDate = $('#expDate').val();
			var cvn2 = $('#cvn2').val();
			if(!phoneNo.match(/^(1)[0-9]{10}$/)){
				layer.open({
					content:'预留手机号码不合法',
						skin: 'msg',
						time: 2 //2秒后自动关闭
					});
			}else if(expDate == ''){
				layer.open({
					content:'有效期不能为空',
						skin: 'msg',
						time: 2 //2秒后自动关闭
					});
			} else if(cvn2 == ''){
				layer.open({
				content:'安全码不能为空',
						skin: 'msg',
						time: 2 //2秒后自动关闭
					});
			}else{
				Public.bundQuickBankCard({
				userId: localStorage.userId,
				bankId: localStorage.bankId,
				customerName: localStorage.userName,
				certId: localStorage.cardNo,
				bankName: localStorage.bankName,
				acctNo: localStorage.acctNo,
				phoneNo: phoneNo,
				cardType: '22',
				expDate: expDate,
				cvn2: cvn2
			},function(res){
				layer.open({
				content: '添加信用卡成功！',
						skin: 'msg',
						time: 2 //2秒后自动关闭
					});
			});
			}
		});
	</script>
</html>
